﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace OfficeServer
{
    public class PeerData
    {
        public uint InterfaceIndex;
        public String Name;
        public String Type;
        public String Domain;
        public IPAddress Address;
        public int Port;
        public int Status = 0;

        public override String ToString()
        {
            return Name;
        }

        public override bool Equals(object other)
        {
            bool result = false;

            if (other != null)
            {
                if ((object)this == other)
                {
                    result = true;
                }
                else if (other is PeerData)
                {
                    PeerData otherPeerData = (PeerData)other;

                    result = (this.Name == otherPeerData.Name);
                }
            }

            return result;
        }

        public override int GetHashCode()
        {
            return Name.GetHashCode();
        }
    };
}
